﻿using System;
using System.Security.Cryptography;
using System.IO;

class Ex1SHA1OfFile
{
    static void Main()
    {
        SHA1CryptoServiceProvider sha1encription = new SHA1CryptoServiceProvider();
        using (FileStream reader = new FileStream(@"C:\machec.txt", FileMode.Open))
        {
            byte[] data = new byte[reader.Length];
            reader.Read(data, 0, (int)reader.Length);
            Console.WriteLine(Convert.ToBase64String(sha1encription.ComputeHash(data)));
        }
    }
}

